package com.sziit.se.highconcurrency.common.tool;

import cn.hutool.crypto.digest.MD5;

public class PasswordUtils {
    private PasswordUtils() {
    }

    //生成密码加盐方法
    public static String generate(String password, String salt) {
        return MD5.create().digestHex(password + salt);
    }

    //判断密码是否正确
    public static boolean matches(String password, String salt, String encryptPassword) {
        return encryptPassword.equals(generate(password, salt));
    }
}
